// 封装与频道的相关操作
import axios from '@/utils/request'

// 获取用户频道
export const getChannels = () => {
  return axios({
    method: 'GET',
    url: '/app/v1_0/user/channels'
  })
}

/**
 * 获取系统中所有的频道
 */
export const getAllChannels = () => {
  return axios({
    method: 'GET',
    url: '/app/v1_0/channels'
  })
}
// 添加频道
export const addChannel = (channels) => {
  return axios({
    method: 'PUT',
    url: '/app/v1_0/user/channels',
    data: {
      channels: channels
    }
  })
}
/**
 * 删除指定id的频道
 * @param {*} channelId 要删除的频道的id
 */
export const deleteChannel = channelId => {
  return axios({
    method: 'DELETE',
    url: '/app/v1_0/user/channels',
    data: {
      channels: [channelId]
    }
  })
}
